#!/bin/bash

HOSTS="creek01,creek01,creek02,creek02,creek03,creek03,creek04,creek04,creek05,creek05,creek07,creek07,creek08,creek08"
NODES="3 5 9" 
PRECISION="512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576"
REPEAT=1
OUTPUT="./output/output"

for i in $NODES
do
	echo "# start " $(date) | tee $OUTPUT$(($i - 1))".dat"
done

for i in $NODES
do
	for j in $PRECISION
	do
		CNT=0
		while [ $CNT -lt $REPEAT ]
		do	
			echo "Nodes i " $i " Precision j " $j " Repeat " $CNT
			mpirun -host $HOSTS -np $i ./bin/mpipi -i $j | tee -a $OUTPUT$(($i -1))".dat"
			CNT=$(($CNT + 1))
		done
	done

done

for i in $NODES
do
	echo "# end " $(date) | tee -a $OUTPUT$(($i -1))".dat"
done
